package com.abstract_pizza;

/**
 * @author SnowmanAndBee
 * @version <version>
 * <description>
 * @date 2021/12/15 - 20:46
 */
public class ClamPizza extends Pizza{
    PizzaIngredientFactory ingredientFactory;

    public ClamPizza(PizzaIngredientFactory ingredientFactory) {
        this.ingredientFactory = ingredientFactory;
    }

    /**
     * 需要原料时向工厂要，有工厂决定拿到的原料类型
     */
    @Override
    void prepare() {
        System.out.println("Preparing " + name);
        dough = ingredientFactory.creatDough();
        sauce = ingredientFactory.createSauce();
        cheese = ingredientFactory.createCheese();
    }
}
